using Bookvar.ObjectModel;
using Bookvar.ObjectModel.Actions;

namespace Bookvar.ServiceModel.Actions
{
    public abstract class PersistenceAction : ActionBase
    {
        private readonly IPersistenceService persistenceService;
        private readonly MindMap mindmap;

        protected IPersistenceService PersistenceService
        {
            get { return persistenceService; }
        }

        protected MindMap Mindmap
        {
            get { return mindmap; }
        }

        public override bool CanRedo
        {
            get { return true; }
        }

        public override bool CanUndo
        {
            get { return true; }
        }

        protected PersistenceAction(IPersistenceService persistenceService, MindMap mindmap)
        {
            Contract.RequiresNotNull( persistenceService, "persistenceService" );
            Contract.RequiresNotNull( mindmap, "mindMap" );

            this.persistenceService = persistenceService;
            this.mindmap = mindmap;
        }
    }
}